package org.jetlinks.community.device.service;

import org.hswebframework.web.crud.service.GenericReactiveCrudService;
import org.hswebframework.web.crud.service.ReactiveTreeSortEntityService;
import org.hswebframework.web.id.IDGenerator;
import org.jetlinks.community.device.entity.Region;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegionService extends GenericReactiveCrudService<Region, String> implements ReactiveTreeSortEntityService<Region, String> {

    @Autowired
    private ApplicationEventPublisher eventPublisher;

    public RegionService() {
    }

    public IDGenerator<String> getIDGenerator() {
        return IDGenerator.MD5;
    }

    public void setChildren(Region entity, List<Region> children) {
        entity.setChildren(children);
    }

}
